package com.ruoyi.tongban.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tongban.mapper.UsrParentalChildMapper;
import com.ruoyi.tongban.domain.UsrParentalChild;
import com.ruoyi.tongban.service.IUsrParentalChildService;

/**
 * 家长-孩子关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-08-02
 */
@Service
public class UsrParentalChildServiceImpl implements IUsrParentalChildService 
{
    @Autowired
    private UsrParentalChildMapper usrParentalChildMapper;

    /**
     * 查询家长-孩子关联
     * 
     * @param parentalChildId 家长-孩子关联ID
     * @return 家长-孩子关联
     */
    @Override
    public UsrParentalChild selectUsrParentalChildById(Long parentalChildId)
    {
        return usrParentalChildMapper.selectUsrParentalChildById(parentalChildId);
    }

    /**
     * 查询家长-孩子关联列表
     * 
     * @param usrParentalChild 家长-孩子关联
     * @return 家长-孩子关联
     */
    @Override
    public List<UsrParentalChild> selectUsrParentalChildList(UsrParentalChild usrParentalChild)
    {
        return usrParentalChildMapper.selectUsrParentalChildList(usrParentalChild);
    }

    /**
     * 新增家长-孩子关联
     * 
     * @param usrParentalChild 家长-孩子关联
     * @return 结果
     */
    @Override
    public int insertUsrParentalChild(UsrParentalChild usrParentalChild)
    {
        usrParentalChild.setCreateTime(DateUtils.getNowDate());
        return usrParentalChildMapper.insertUsrParentalChild(usrParentalChild);
    }

    /**
     * 修改家长-孩子关联
     * 
     * @param usrParentalChild 家长-孩子关联
     * @return 结果
     */
    @Override
    public int updateUsrParentalChild(UsrParentalChild usrParentalChild)
    {
        usrParentalChild.setUpdateTime(DateUtils.getNowDate());
        return usrParentalChildMapper.updateUsrParentalChild(usrParentalChild);
    }

    /**
     * 批量删除家长-孩子关联
     * 
     * @param parentalChildIds 需要删除的家长-孩子关联ID
     * @return 结果
     */
    @Override
    public int deleteUsrParentalChildByIds(Long[] parentalChildIds)
    {
        return usrParentalChildMapper.deleteUsrParentalChildByIds(parentalChildIds);
    }

    /**
     * 删除家长-孩子关联信息
     * 
     * @param parentalChildId 家长-孩子关联ID
     * @return 结果
     */
    @Override
    public int deleteUsrParentalChildById(Long parentalChildId)
    {
        return usrParentalChildMapper.deleteUsrParentalChildById(parentalChildId);
    }
}
